<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.entity.Idea" %>
<!DOCTYPE HTML>
<html >
<head>
	<meta charset="UTF-8">
	<title>凯胜项目管理系统</title>
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<link rel="stylesheet" href="static/css/daohang.css" type="text/css" />
	<link rel="stylesheet" href="static/css/style.css" type="text/css" />
	<style type="text/css">
		.icon-while{
			background-image: url("static/img/glyphicons-halflings-white.png");
		}
		
		body{
			background-image:url("static/img/bg_main.jpg");
		}
	</style>
</head>
<body>
	<%@ include file="include/top2.jsp" %>
	<jsp:include page="include/top.jsp">
		<jsp:param value="idea" name="tag"/>
	</jsp:include>
	<div class="container">
		<div class="row">
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
					<li class="active">
						<a href="#"><i class="icon-folder-open"></i>想法</a>
					</li>
					<li class="pull-right"><i class="icon-plus"></i><a href="idea.jspx?m=share" class="link-black">分享新想法</a></li>
				</ul>
				<div class="wall" style="margin-bottom:20px;">
					<c:forEach items="${page.result}" var="p">
					<br/>
					<blockquote>
						
						<h3><a href="idea.jspx?m=show&id=${p.id }">${p.ideaName }</a></h3><br>
						<p style="font-size:16px;line-height:1.5;text-indent:30px;">${p.message }</p>
						
						<br>
						<div style="margin-left:60px;"><img alt="" src="img/${up.user.image }">${p.user.userName }</div>
						<div style="margin-left:480px;"><small>${p.time }</small></div>
						<div style="margin-left:590px;">
						<c:choose>
							<c:when test="${p.user.id eq up.userid}">
								<a href="idea.jspx?m=edit&id=${p.id }" title="修改">修改<i class="icon-pencil"></i></a>
								<a href="idea.jspx?m=del&idq=${p.id }" title="删除">删除<i class="icon-trash"></i></a>
							</c:when>
							<c:when test="${up.role eq 'manager'}">
								<a href="idea.jspx?m=edit&id=${p.id }" title="修改"><i class="icon-pencil"></i></a>
								<a href="idea.jspx?m=del&idq=${p.id }" title="删除"><i class="icon-trash"></i></a>
							</c:when>
							<c:otherwise>
							</c:otherwise>
						</c:choose>
						</div>
							<br>
							<div style="height:20px;"></div>
							<div id="hidden" style= "display:block;" >
								<form action="idea.jspx?m=say&id=${p.id}" method="post">
									<textarea style="border-radius:3px 3px 3px 3px;" class="span9" name="imsg" rows="3" placeholder="请对该项目提出宝贵的建议" ></textarea>
									<br>
									<input type="submit" value="评论" style="width:30px;border-radius:10px 0px 10px 0px;margin-left:610px;color:#0088cc"/>
								</form>
							</div>
						
						</blockquote>
						<br/>
					
						<blockquote>
							<h3>评论</h3>
							<br>
						<c:forEach items="${co}" var="com" >
							<c:if test="${com.ideaid eq p.id }">
							<div style="margin-left:40px"><img width="64px" src="img.jspx?img=${com.user.image}">&nbsp;${com.user.userName }&nbsp;&nbsp;:<div style="text-indent:30px;">${com.message}</div><br>
								<div style="margin-left:510px;">${com.time }</div></div>
							</c:if>
							<br>
						</c:forEach>
						</blockquote>	
					</c:forEach>
				
					<div class="pagination pull-right">
				
				  		<%-- 共${page.totalPages }页当前第${page.pageNum }页 --%>
				  		<ul>
				  		<li>
						  	<c:choose>
					  		<c:when test="${page.pageNum == 1 }">
					  			<a href="#">首页</a>
					  		</c:when>
					  		<c:otherwise>
							  	<a href="idea.jspx?p=1">首页</a>
					  		</c:otherwise>
					  	</c:choose>
					  	</li>
					  	<li>
					  	<c:choose>
					  		<c:when test="${page.pageNum == 1 }">
					  			<a>上一页</a>
					  		</c:when>
					  		<c:otherwise>
							  	<a href="idea.jspx?p=${page.pageNum - 1 }">上一页</a>
					  		</c:otherwise>
					  	</c:choose>
					  	</li>
					  	<li>
					  	<c:choose>
					  		<c:when test="${page.pageNum == page.totalPages }">
					  			<a href="#">下一页</a>
					  		</c:when>
					  		<c:otherwise>
							  	<a href="idea.jspx?p=${page.pageNum + 1 }">下一页</a>
					  		</c:otherwise>
					  	</c:choose>
					  	</li>
					  	<li>
					  	<c:choose>
					  		<c:when test="${page.pageNum == page.totalPages }">
					  			<a href="#">尾页</a>
					  		</c:when>
					  		<c:otherwise>
							  	<a href="idea.jspx?p=${page.totalPages}">尾页</a>
					  		</c:otherwise>
					  	</c:choose>
					  	</li>
					  	</ul>
					</div>
					<div class="clear"></div>
				</div>
			</div>
			<div class="span3">
			
			</div>
		
		</div>
		
	</div>
	
	<script type="text/javascript" src="static/js/jquery.js"></script>
	<script type="text/javascript" src="static/js/jqueryui.js"></script>
	<script type="text/javascript" src="static/js/jquery.illuminate.0.7.min.js"></script>
	
	<script type="text/javascript">
		$(document).ready(function(){
				
			$('#button').illuminate({
				'intensity': '0.5',
				'color': '#2c2c2c'
			});
			
		});
		
	</script>
</body>
</html>